package com.gutsyzhan.bilibili.service.impl;

import com.gutsyzhan.bilibili.dao.AuthRoleDao;
import com.gutsyzhan.bilibili.domain.auth.AuthRole;
import com.gutsyzhan.bilibili.domain.auth.AuthRoleElementOperation;
import com.gutsyzhan.bilibili.domain.auth.AuthRoleMenu;
import com.gutsyzhan.bilibili.service.AuthRoleElementOperationService;
import com.gutsyzhan.bilibili.service.AuthRoleMenuService;
import com.gutsyzhan.bilibili.service.AuthRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

@Service
public class AuthRoleServiceImpl implements AuthRoleService {
    /**
     * 查询角色-操作关联信息
     */
    @Resource
    private AuthRoleElementOperationService authRoleElementOperationService;

    /**
     * 查询角色-菜单关联信息
     */
    @Resource
    private AuthRoleMenuService authRoleMenuService;

    @Resource
    private AuthRoleDao authRoleDao;

    @Override
    public List<AuthRoleElementOperation> getRoleElementOperationByRoleIds(Set<Long> roleIds) {
        return authRoleElementOperationService.getRoleElementOperationByRoleIds(roleIds);
    }

    @Override
    public List<AuthRoleMenu> getRoleMenuByRoleIds(Set<Long> roleIds) {
        return authRoleMenuService.getRoleMenuByRoleIds(roleIds);
    }

    @Override
    public AuthRole getRoleByCode(String roleCode) {
        return authRoleDao.getRoleByCode(roleCode);
    }
}
